package com.yh.correct.shiro;

import java.security.MessageDigest;

/**
 * Created by Administrator on 2017/8/14.
 */
public class MyMd5Util {

    private static final String passWord="0123456789ABCDEF";
    private static final Integer sal=12;

    public static byte[] hexStringToByte(String hex){

        int len=(hex.length()/2);
        byte[]result=new byte[len];
        char[]hexChars=hex.toCharArray();
        for(int i=0;i<len;i++){
            int pos=i*2;
            result[i]=(byte)(passWord.indexOf(hexChars[pos]<<4 |passWord.indexOf(hexChars[pos+1])));
        }


        return result;

    }
}
